// RunCmdlineInfo.cpp: implementation of the CRunCmdlineInfo class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"

#include "RunCmdlineInfo.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CRunCmdLineInfo::CRunCmdLineInfo()
{
	m_bInstall = FALSE;
	m_bUninstall = FALSE;
	m_bSetup = FALSE;
}

CRunCmdLineInfo::~CRunCmdLineInfo()
{

}



void CRunCmdLineInfo::ParseParam(const TCHAR*pszParam,
									 BOOL bFlag,BOOL bLast)
{
	CString sArg(pszParam);
	if(bFlag)
	{
		m_bInstall=!sArg.CompareNoCase(_T("install"));
		m_bUninstall=!sArg.CompareNoCase(_T("uninstall"));
		m_bSetup=!sArg.CompareNoCase(_T("setup"));
	}
	//m_strFileNamegetsthefirstnonflagname
	else if(m_strFileName.IsEmpty())
	{
		m_sArgString=sArg;
		m_strFileName = sArg;
	}
}
BOOL CRunCmdLineInfo::GetParamFlag(RunParams nParam)
{
	BOOL bRet = FALSE;
	switch (nParam)
	{
	case rpInstall:
		bRet = m_bInstall;break;
	case rpUninstall:
		bRet = m_bUninstall;break;
	case rpSetup:
		bRet = m_bSetup;break;
	case rpNone:
	default:
		bRet = FALSE;break;
	}
	return bRet;
}
